package com.pt.site.page;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.pt.site.label.ILabel;
import com.pt.site.resource.IResource;

public class StandardPage implements IPage {

	private final String url;
	private final String title;
	private final String thumbnailUrl;
	private final List<IResource> resources;
	private final List<ILabel> labels;
	
	public StandardPage(String url, String title, String thumbnailUrl) {
		this.url = url;
		this.title = title;
		this.thumbnailUrl = thumbnailUrl;
		this.resources = new ArrayList<IResource>();
		this.labels = new ArrayList<ILabel>();
	}
	
	@Override
	public List<IResource> getResources() {
		return Collections.unmodifiableList(resources);
	}
	
	@Override
	public String getUrl() {
		return url;
	}

	@Override
	public String getTitle() {
		return title;
	}

	@Override
	public String getThumbnailUrl() {
		return thumbnailUrl;
	}

	@Override
	public List<ILabel> getLabels() {
		return Collections.unmodifiableList(labels);
	}

	@Override
	public void addResource(IResource resource) {
		if (resource != null) {
			resources.add(resource);
		}
	}

	@Override
	public void addLabel(ILabel label) {
		if (label != null) {
			labels.add(label);
		}
	}

}
